<template>
	<view style="opacity: 1;" >
		<view v-if="screenWidth<480" class="flex-shrink" style="height:200rpx;"></view>
		<view v-if="screenWidth<480" class="fixed-top w-100 xpy flex align-end justify-center bg-light" style="height: 200rpx;">
			<uni-icons v-if="gi>1&&!isSubmit" @click="handleBack()" type="left" style="position: absolute;left: 20rpx; bottom: 20rpx;" size="25"></uni-icons>
			<uni-icons v-if="isSubmit" @click="handleSubmit()" type="left" style="position: absolute;left: 20rpx; bottom: 20rpx;" size="25"></uni-icons>
			<text class="font pb-2">{{tabName}}</text>
		</view>
		<!-- <view v-else class="fixed-top flex" style="height: 100rpx;" :style="{backgroundColor: tabBar.backgroundColor}">
			<view class="xpy flex align-center font text-success">
				<text v-if="!isLogin" class="mr-5" @click="handleLogin">请登录</text>
				<text v-if="!isLogin" @click="handleZHUCE">免费注册</text>
				<text v-if="isLogin" class="mr-5">欢迎！*</text>
				<text v-if="isLogin" @click="handleExit">退出</text>
			</view>
		</view> -->
	</view>
</template>

<script>
	const app = getApp();
	export default {
		data() {
			return {
				isLogin:true,
				gi:1,
				screenWidth: uni.getSystemInfoSync().windowWidth,
				tabBar: {
					selectedColor: '#dc3545',
					screenWidth:uni.getSystemInfoSync().windowWidth,
					backgroundColor: '#ffffff',
					Chidren:{
						list: [{
							pagePath: "/pages/index/index",
							text: "首页",
							iconPath: "/index.png",
							selectedIconPath: "/index1.png"
						},
						{
							pagePath: "/pages/SupplyAndMarketing/SupplyAndMarketing",
							text: "合美供销",
							iconPath: "/serve.png",
							selectedIconPath: "/serve1.png"
						},
						{
							pagePath: "/pages/customerService/customerService",
							text: "客服",
							iconPath: "/serve.png",
							selectedIconPath: "/serve1.png"
						}, {
							pagePath: "/pages/shopCart/shopCart",
							text: "购物车",
							iconPath: "/shopcar.png",
							selectedIconPath: "/shopCar1.png"
						}, {
							pagePath: "/pages/my/my",
							text: "我的",
							iconPath: "/myself.png",
							selectedIconPath: "/myself1.png"
						}]
					}
				},
			}
		},
		props:{
			tabName: { //总计金额
				type: String,
				default: ''
			},
			isSubmit:{
				type:Boolean,
				default: false
			}
		},
		methods: {
			handleLogin(){
				window.location.href='https://marketing.ediblefungus.cn/dist/h5XKLJ/index.html#/pages/login/login';
			},
			handleZHUCE(){
				window.location.href='https://marketing.ediblefungus.cn/dist/h5XKLJ/index.html#/pages/login/register';
			},
			handleBack(){//后退
				uni.navigateBack()
			},
			handleSubmit(){//提交
				this.$emit('submit');
			},
			
		},
		mounted() {
			this.gi = getCurrentPages().length
		}
	}
</script>

<style scoped lang="scss">
@media screen and(min-width:480px){
	.xpy{
		width: 800rpx;
		margin: 0 auto;
	}
}
</style>